package edu.sctu.lab03;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

//一般情况下，这个类继承了HttpServlet
public class IndexServlet extends HttpServlet {
    @Override//重写（输入doGet会出现）
    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response)
            throws ServletException, IOException {
        //如何得到out变量？
        PrintWriter out=response.getWriter();
        out.write("<h1>hello,servlet!</h1>");

    }
}
